/**
 * 作者 ：食草狂魔
 *
 * 日期 ：2017/12/04
 *
 * 描述 ：状态树模块-系统管理
 */

export default {
  state: {
    pages: {
      // 角色管理
      role: {
        roleName: "",
        createTimeToStart: "",
        createTimeToEnd: ""
      },
      // 部门管理
      department: {
        searchContent: "",
        createTimeToStart: "",
        createTimeToEnd: ""
      }
    }
  },
  mutations: {
    reloadTableParams (state, obj) {
      state.pages.role.roleName = obj.roleName
      state.pages.role.createTimeToStart = obj.createTimeToStart
      state.pages.role.createTimeToEnd = obj.createTimeToEnd
    },
    reloadDepartmentTableParams (state, obj) {
      state.pages.department.searchContent = obj.searchContent
      state.pages.department.createTimeToStart = obj.createTimeToStart
      state.pages.department.createTimeToEnd = obj.createTimeToEnd
    }
  },
  actions: {
    searchTable ({ state, commit, rootState }, obj) {
      commit('reloadTableParams', obj)
    },
    searchDepartmentTable ({ state, commit, rootState }, obj) {
      commit('reloadDepartmentTableParams', obj)
    }
  }
}
